cmake_minimum_required(VERSION 3.14)
project(aoa)


set(CMAKE_CXX_STANDARD 11)
find_package(PkgConfig)
add_definitions(-Wall -Werror)
#pkg_search_module(usb ao libusb-1.0 )
include_directories(./inc)
IF (CMAKE_C_COMPILER MATCHES "/root/bin/nxp-gcc"   )
    MESSAGE(WARNING  "Cross compile ")
    set(CROSS "/root/imx6dlsabresd/")
    include_directories(${CROSS}/usr/include/libusb-1.0 ${CROSS}/include inc)
    link_directories(/root/imx6dlsabresd/lib /root/imx6dlsabresd/usr/lib)
else ()
    MESSAGE(WARNING  "PC compile ")
    include_directories("/usr/include/libusb-1.0")
ENDIF ()

message(WARNING ${CMAKE_BUILD_TYPE} )
message(WARNING ${CMAKE_C_COMPILER})
message(WARNING ${LIBS_LIBRARIES})
message(WARNING ${LIBS_INCLUDE_DIRS})


add_executable(aoa src/AOAaudio.cpp src/AOADev.cpp src/HotPlug.cpp src/main.cpp src/Phone.cpp inc/AOAaudio.h inc/AOADev.h inc/headerBase.h inc/HotPlug.h inc/Manager.h inc/PhoneBase.h inc/Phone.h inc/AOAManager.h src/AOAManager.cpp)
target_link_libraries(aoa ${LIBS_LIBRARIES} pthread)
set(CMAKE_VERBOSE_MAKEFILE true)
set(CMAKE_CXX_FLAGS_DEBUG "-g -o0 -ggdb3")

